The world of the stock market attracts so many people towards itself. Because of the limelight, it exhibits people are drawn towards it. Many people are afraid of the stock market may be due to the stories of various investors going bankrupt, or due to their own experience of loss. That's why they advise others not to get involved in any investment or trading activities in the stock market as what they know or have experienced themselves proved to be a bitter experience. The losses are not the problem but the lack of proper knowledge or guidance is.
The profits and losses are a part of investment and trading. It's true that even the most experienced traders and investors also suffer losses but what they do is lower their probability of losses. A beginner doesn't understand this and invest his money randomly and suffer loss. If somehow the trade or investment results in profit then he considers himself as omniscient and next time invests more money and this time his plan backfires and the trade results in a loss. Many times the whole fund is lost. Whatever money they have earned in their life with hard work is lost, so they advise others also not to get into this. Their own greed and lack of knowledge were the reason for their loss but they don't admit it.
Even the ones who are learning about the correct way of trading make mistakes and let their greed overshadow their knowledge. One should understand that greedy sentiment will make them getting carried away. The fund one should invest in the stock market should be an amount of which loss can one bear with no harsh regret, but this does not mean that one should throw his money in the stock market or should not expect profits. The reason one invests in the market is to earn some profit. So gathering proper knowledge and learning the correct way of performing these investments should be the goal for any beginner. There will be times when one would see perfect opportunities for making huge profits but one should maintain his composure as there are endless opportunities in the market to make money.
So "First learn then invest" is the key to become a profitable trader/investor.